package cn.iocoder.yudao.module.api.member.vip.enums;

import cn.iocoder.yudao.framework.business.basic.enums.EnumValuable;
import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * 会员类型枚举
 *
 * @author 山野羡民（1032694760@qq.com）
 */
@Getter
@AllArgsConstructor
public enum VipTypeEnum implements EnumValuable {

    NONE(-1, "普通用户"),
    MEMBER(0, "VIP用户"),
    MERCHANT(1, "VIP商家"),
    ;

    @EnumValue
    private final Integer value;
    private final String name;

   public static VipTypeEnum valueOf(Integer value) {
        for (VipTypeEnum item : values()) {
            if (Objects.equals(item.getValue(), value)) {
                return item;
            }
        }
        return NONE;
    }

}
